fromList

Validated string based on a list of allowable strings

Default value will be the first string in the list.

Author

fzzyhmstrs

Since

0.2.6

Parameters

strings

List$lt;String> - the list of allowable string values, can't be empty.

Throws

Passed list can't be empty.


fun fromList(defaultValue: String, strings: List<String>): ValidatedString

Validated string based on a list of allowable strings, with a provided default value

Author

fzzyhmstrs

Since

0.2.6

Parameters

defaultValue

String - the default string value, must be in the strings list

strings

List$lt;String> - the list of allowable string values, can't be empty.

Throws

Passed list can't be empty; default value must be in the strings list.


fun fromList(defaultValue: String, strings: Supplier<List<String>>): ValidatedString

Validated string based on a list of allowable strings, with a provided default value

NOTE: the default value provided should be present in the supplied list at some point (doesn't have to be at launch). Otherwise, the default value shown will be immediately invalid on use. Since the list is supplied, this can't be checked up front when list validation may be weak.

Author

fzzyhmstrs

Since

0.2.6

Parameters

defaultValue

String - the default string value, must be in the strings list

strings

List$lt;String> - the list of allowable string values, can't be empty.